package com.markerhub.config;

import com.markerhub.mapper.TeachingCallingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
public class SchedulingConfig {

    @Autowired
    private TeachingCallingMapper callingMapper;

    @Scheduled(fixedRate = 60000) // 每分钟执行一次
    public void updateExpiredCalls() {
        callingMapper.updateExpiredCalls();
    }
}
